import axios from '@/libs/api.request'
import qs from 'qs'
// 根据字典码获取字典表
export const getSelectOption = (params) => {
    return axios.request({
      url: 'admins/dataDict/getDictByCode?t='+new Date().getTime(),
      method: 'get',
      params
    })
  }

  export const getSelectOption2 = (params) => {
    return axios.request({
      url: 'admins/dataDict/getDictByCodeSystem?t='+new Date().getTime(),
      method: 'get',
      params
    })
  }

// 获取所有用户
export const getAllPeople = (params) => {
    return axios.request({
      url: 'admins/admin/getAll?t='+new Date().getTime(),
      method: 'get',
      params
    })
  }

// 获取当前时间
export const getTime = () => {
  var myDate = new Date();
  //获取当前年
 var year = myDate.getFullYear();
 //获取当前月
 var month = myDate.getMonth() + 1;
  //获取当前日
  var date = myDate.getDate();
  var h = myDate.getHours();
  var m = myDate.getMinutes();
  var s = myDate.getSeconds();
 return year + '-' + conver(month) + "-" + conver(date) + " " + conver(h) + ':' + conver(m) + ":" + conver(s);
}

function conver(s) {
  return s < 10 ? '0' + s : s;
}

// 获取电站，机组，HD
export const getAllEqu = (params) => {
  return axios.request({
    url: 'admins/equipment/getAll?t='+new Date().getTime(),
    method: 'get',
    params
  })
}
